﻿using System;
using System.Windows;
using System.Windows.Data;

namespace Kiva7.ValueConverter
{
    public class IntVisibility : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (!(value is int))
            {
                return Visibility.Collapsed;
            }
            int i = (int)value;
            if (i == 0)
            {
                return Visibility.Collapsed;
            }
            else
            {
                return Visibility.Visible;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return null;
        }
    }
}
